//
//  UILabel+Extension.swift
//  sina
//
//  Created by Kent on 16/9/25.
//  Copyright © 2016年 Ming. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title: String, fontSize: CGFloat, textColor: UIColor) {
        
        self.init()
        
        text = title
        font = UIFont.systemFont(ofSize: fontSize)
        self.textColor = textColor
        numberOfLines = 0
        preferredMaxLayoutWidth = 224
        textAlignment = .center
        sizeToFit()
        
    }
 
}

extension UIButton {
    
    convenience init(title: String, fontSize: CGFloat, textColor: UIColor) {
        
        self.init()
        
        setTitle(title, for: .normal)
        setTitleColor(textColor, for: .normal)
        titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        sizeToFit()
        
    }
    
    convenience init(nrtitle: String, fontSize: CGFloat, textColor: UIColor) {
        
        self.init()
        
        setTitle(nrtitle, for: .normal)
        setTitleColor(textColor, for: .normal)
        titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        
    }
    
}
























